import { TableColumnsType, Tooltip, Typography } from 'antd'
import { SysAnnouncementVO as ITableData } from './types'
export const useIndexColumns = ({ onEdit }: { onEdit: (rows: ITableData) => void }): TableColumnsType<ITableData> => [
  {
    title: '开始时间',
    dataIndex: 'beginTime',
    key: 'beginTime',
    align: 'center',
    width: 100,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '结束时间',
    dataIndex: 'endTime',
    key: 'endTime',
    align: 'center',
    width: 100,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '公告内容',
    dataIndex: 'mainContent',
    key: 'mainContent',
    align: 'center',
    width: 130,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '操作',
    dataIndex: 'mainContent',
    key: 'mainContent',
    align: 'center',
    fixed: 'right',
    width: 30,
    render: (_, rows) => {
      return <Typography.Link onClick={() => onEdit(rows)}>编辑</Typography.Link>
    },
  },
]
